package com.example.week2.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.week2.R;
import com.example.week2.entity.JavaBean;
import java.util.List;

public class MyAdapter extends BaseQuickAdapter<JavaBean, BaseViewHolder>{

    public MyAdapter(int layoutResId, @Nullable List<JavaBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, JavaBean item) {
        ImageView view = helper.getView(R.id.iv);
        helper.setText(R.id.tv,item.getTravels_title());
        Glide.with(mContext).load(item.getTravels_img()).into(view);
    }
}
